package com.tangcco.lockwell.utility;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class ConvertCamelToUnderline {
    public static String bigToSmall(String input) {
        Pattern pattern = Pattern.compile("[A-Z]");
        Matcher matcher = pattern.matcher(input);
        StringBuffer sb = new StringBuffer();
        while (matcher.find()) {
            matcher.appendReplacement(sb, "_" + matcher.group(0).toLowerCase());
        }
        return matcher.appendTail(sb).toString();
    }
}
